how logs moving from log files to database files